The invention generally relates to disk arrays and, more particularly, the invention relates to the preparation of disks for use in disk arrays.
A disk array is a cluster of disks controlled via an input/output control processor. To a computer system accessing the disk array, the disk array appears as a single disk drive. In general, a disk array having a particular capacity is more reliable and provides better performance than a large single disk drive of similar capacity.
A disk is a medium on which data can be recorded. For example, the data may be recorded using magnetic read/write heads or the data may be recorded using laser beams. Before data can be recorded on a disk, however, the disk must be formatted. In general, disk formatting defines the tracks and sectors on the disk. Typically, tracks are concentric circles around the disk and sectors are segments within each concentric circle.
After formatting, a disk is then prepared for use in a disk array. The preparation includes writing xe2x80x9cinitial statexe2x80x9d data into each sector on the disk or into each sector in a range of sectors on the disk. When writing initial state data into a particular sector on the disk, the input/output control processor sends a command to the disk, across a channel connecting the processor to the disk, instructing the disk to write the initial state data into the particular sector on the disk. Thus, in preparing a disk for use in a disk array, the input/output control processor must send the command to write data (along with the data to be written) across the channel for each sector on the disk or for each sector in a range of sectors on the disk. As a result, the process for preparing a disk for use in a disk array can take hours to perform, especially when preparing a large number of disks for use in a disk array.
For example, in preparing a disk array for shipment to the customer, the multiple disks in the disk array are prepared at substantially the same time, using, for example, parallel write commands sent over the channel. Yet, it still takes more than 9 hours to prepare the disks in a medium-sized disk array, for example, a disk array containing 20-9 gigabyte disks and 20-18 gigabyte disks, for use in the disk array. Moreover, when preparing a disk for use in a disk array, the initial state data written into each sector on the disk or into each sector in a range of sectors on the disk must be consistent with the initial state data written into each sector on the other disks in the disk array or into each sector in a range of sectors on the other disks in the disk array. For example, initial state data for sectors that will contain parity data calculated for a selection of user data must be consistent with the initial state data for the sectors containing the user data.
In accordance with one aspect of the invention, a method and apparatus for preparing a disk for use in a disk array includes an input/output control processor and a disk having sectors, the sectors including a data area and a metadata area. First, the method and apparatus defines a range of sectors to prepare for use in the disk array. Then, the method and apparatus sends a command and a block of initial state data to the disk from the input/output control processor. The command instructs the disk to write the block of initial state data to each sector in a group of sectors on the disk. The group of sectors on the disk is located within the defined range of sectors on the disk. The block of initial state data is comprised of a bit stream of data for writing to the data area and the metadata area of each sector. Last, the method and apparatus writes the block of initial state data to each of the sectors in the group of sectors on the disk.
In a further embodiment of the invention, the method and apparatus determines that the block of initial state data has not been written to all of the sectors within the defined range of sectors on the disk. In this embodiment, the method and apparatus then sends another command to the disk to write the block of initial state data to at least one of the unprepared sectors within the defined range of sectors. Last, the method and apparatus writes the block of initial state data to the at least one unprepared sector.
In accordance with another aspect of the invention, a method and apparatus for preparing more than one disk for use in a disk array includes an input/output control processor and disks having sectors, the sectors including a data area and a metadata area. First, the method and apparatus defines for each disk a range of sectors to prepare for use in the disk array. Then, the method and apparatus sends a command and a block of initial state data to each of the disks from the input/output control processor. The command instructs each disk to write the block of initial state data to each sector in a group of sectors on the disk. The group of sectors on each disk is located within the defined range of sectors for the disk. The block of initial state data is comprised of a bit stream of data for writing to the data area and the metadata area of each sector. Last, the method and apparatus writes the block of initial state data for each disk to each sector in the group of sectors on the disk.
In a further embodiment of the invention, the method and apparatus determines that the block of initial state data has not been written to all of the sectors within the defined range of sectors on at least one disk. In this embodiment, the method and apparatus then sends another command to the at least one disk to write the block of initial state data for the at least one disk to at least one of the unprepared, that is, unwritten, sectors within the defined range of sectors. Last, the method and apparatus writes the block of initial state data to the at least one unprepared sector.
In a still further embodiment of the invention, the block of initial state data for each disk is the same block of initial state data. Or, in an alternative embodiment, the block of initial state data for at least one disk is different from the block of initial state data for the other disks.
In a further embodiment of both aspects of the invention, the method and apparatus also marks the prepared disk, or at least one of the prepared disks, with a signature. The signature signals to the input/output control processor that the disk is prepared for use in a disk array.
In alternate embodiments of both aspects of the invention, the metadata area may include a checksum area, a time stamp area, a write stamp area, or a shed stamp area. In addition, the block of initial state data may include a bit stream of zeros for writing to the data area, or a bit stream of zeros and ones for writing to the checksum area, or a bit stream of ones for writing to the time stamp area, or a bit stream of zeros for writing to the write stamp area, or a bit stream of zeros for writing to the shed stamp area.
In further alternate embodiments of both aspects of the invention, the sectors on the disk may be 520 bytes in length, the data area of the sectors may be 512 bytes in length, and the metadata area of the sectors may be 8 bytes in length. In addition, the command being sent may include the Small Computer System Interface Write Same command. Also, the disk array may be configured as a Redundant Array of Independent Disks.
In still further alternate embodiments to both aspects of the inventions, the group of sectors on the disk may be the same as the defined range of sectors on the disk. In addition, the defined range of sectors on the disk may include all of the sectors on the disk.